home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / Ioc_SetOwner.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-30  |  1.5 KB  |  57 lines

  1. /* 
  2.  * Ioc_SetOwner.c --
  3.  *
  4.  *    Source code for the Ioc_SetOwner library procedure.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: Ioc_SetOwner.c,v 1.2 88/07/29 18:34:45 ouster Exp $ SPRITE (Berkeley)";
  18. #endif not lint
  19.  
  20. #include <sprite.h>
  21. #include <fs.h>
  22.  
  23.  
  24. /*
  25.  *----------------------------------------------------------------------
  26.  *
  27.  * Ioc_SetOwner --
  28.  *    Set the ID of the process or group associated with the device.
  29.  *    This is used, for example, to implement control over a tty
  30.  *    device so that background jobs can't read input.
  31.  *
  32.  * Results:
  33.  *    None.
  34.  *
  35.  * Side effects:
  36.  *    Set the ID.
  37.  *
  38.  *----------------------------------------------------------------------
  39.  */
  40.  
  41. ReturnStatus
  42. Ioc_SetOwner(streamID, id, procOrFamily)
  43.     int streamID;
  44.     int id;
  45.     int procOrFamily;
  46. {
  47.     register ReturnStatus status;
  48.     Ioc_Owner owner;
  49.  
  50.     owner.id = id;
  51.     owner.procOrFamily = procOrFamily;
  52.  
  53.     status = Fs_IOControl(streamID, IOC_SET_OWNER, sizeof(Ioc_Owner),
  54.             (Address)&owner, 0, (Address)NULL);
  55.     return(status);
  56. }
  57.